#include <stddef>

#include "majanTiles.h"
#include "marcos.h"


majanTile **majanTiles::tiles = NULL;


majanTile(SET s, int v, bool a) {
	Tiles = NULL;
	
}


mmajanTile **majanTiles::getInstance() {
	if (tiles == NULL) {
		tiles = new majanTile[TILES_START - TILES_END][9];
		
		for (int i = TILES_START; i <= TILES_END; i++) {
			for (j = 0; j <= 9; j++) {
				majanTile[i][j] = new majanTile(i,j,false);
			}
		}
	
	}
	
	return tiles;
	
}


majanTile::~majanTile() {
	if (tiles != NULL) {
	
		for (int i = TILES_START; i <= TILES_END; i++) {
			for (j = 0; j <= 9; j++) {
				delete majanTile[i][j];
			}
		}
	
	}
	
	return;
	
}
	
	

// =========================================


SET majanTile::getSet() {
	return set;
	
}

int majanTile::getValue() {
	return value;
	
}

bool majanTile::isAkaDora() {
	return aka;
	
}



/*

bool majanTile::isDora(const MajanTiles& DoraIndicator) {
	return ((DoraIndicator.set{} == set) && (DoraIndicator.value % 9 + 1 == value));

}

*/